home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
sviluppo
/
svilupp2
/
gmsppr10.lha
/
mylib
/
PError.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-10
|
996b
|
45 lines
#include "MyLib.h"
/****** MyLib.lib/PError *************************************************
*
* NAME
* PError -- output a dos error message
*
* SYNOPSIS
* PError(ErrorCode, Header)
*
* void PError(LONG, const char *);
*
* FUNCTION
* This function works like dos.library/PrintFault(), except that
* it outputs to StdErr.
*
* INPUTS
* ErrorCode - the error code representing the error.
* 0 will cause IoErr() to be used instead.
* Header - an optional header
*
* NOTE
* This function calls ErrorHandle(), which means you will have
* an initialized StdErr stream afterwards.
*
* SEE ALSO
* dos.library/PrintFault(), ErrorHandle()
*
*************************************************************************/
void PError(LONG ErrorCode, const char *String)
{
BPTR OldOutput;
if (!ErrorCode)
{
ErrorCode=IoErr();
}
OldOutput=SelectOutput(ErrorHandle());
Flush(OldOutput);
PrintFault(ErrorCode,(char *)String);
SelectOutput(OldOutput);
}